<?php
function smarty_modifier_timezone($date, $format = 'Y-m-d G:i') {
	$time = strtotime($date);

	$localtimezone = intval(date('Z'));
	$clienttimezone = isset($_COOKIE['timeOffset'])?intval($_COOKIE['timeOffset'])*60:$localtimezone;

	$time_diff = $clienttimezone - $localtimezone;

	return date($format, $time + $time_diff);
}